package net.googlecode.exigenlab.Task3;

import net.googlecode.exigenlab.Task3.workers.Manager;
import net.googlecode.exigenlab.Task3.workers.Boss;
import net.googlecode.exigenlab.Task3.workers.Employee;
import net.googlecode.exigenlab.Task3.workers.Person;


/**
 * Test class that creates all instances of the project
 *
 * @author Vitalii Myshenko <a href="mailto:vitalii.myshenko@gmail.com">
 *
 *  @since 29.03.11
 */
public class SalaryApp {

    /**
     * Calculate salary of workers
     *
     * @param args  parameters for main method
     */
    public static void main(String[] args) {
        SalaryApp salaryApp = new SalaryApp();
        SalaryCalculator cal = new SalaryCalculator();

        cal.getSalary(salaryApp.createBoss());
        cal.getSalary(salaryApp.createEmployeeWithBonus());
        cal.getSalary(salaryApp.createEmployeeWithoutBonus());
        cal.getSalary(salaryApp.createManagerWithBonus());
        cal.getSalary(salaryApp.createManagerWithoutBonus());
    }

    /**
     * Create Manager without bonus
     *
     * @return Manager without bonus
     */
    public Manager createManagerWithoutBonus() {
        Manager manager = new Manager("Ivan", "Ivanov");
        manager.setAge(30);
        manager.setPerHour(true);
        manager.setBonus(false);
        manager.setRate(25);

        return manager;
    }

    /**
     * Create Manager with bonus
     *
     * @return Manager with bonus
     */
    public Manager createManagerWithBonus() {
        Manager manager = new Manager("Petr", "Petrov");
        manager.setAge(35);
        manager.setPerHour(false);
        manager.setBonus(true);
        manager.setBonusAmount(1000);
        manager.setRate(5000);

        return manager;
    }

    /**
     * Create Employee with bonus
     *
     * @return Employee with bonus
     */
    public Employee createEmployeeWithBonus() {
        Employee employee = new Employee("Semen", "Semenov");
        employee.setAge(55);
        employee.setPerHour(true);
        employee.setBonus(true);
        employee.setBonusAmount(1500);
        employee.setRate(8);

        return employee;
    }

    /**
     * Create Employee without bonus
     *
     * @return Employee without bonus
     */
    public Employee createEmployeeWithoutBonus() {
        Employee employee = new Employee("Sergey", "Sergeev");
        employee.setAge(45);
        employee.setPerHour(false);
        employee.setBonus(false);
        employee.setRate(200);
        employee.setExperience(15);

        return employee;
    }

    /**
     * Create Boss
     *
     * @return Boss
     */
    public Boss createBoss() {
        Boss boss = new Boss("Dmitriy", "Ivanov");
        boss.setAge(60);
        boss.setPerHour(false);
        boss.setRate(10000);
        boss.setBonus(true);
        boss.setBonusAmount(1200);

        return boss;
    }
}
